# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=vino
pkgver=3.22.0+3+g67773d0
pkgrel=1
pkgdesc="A VNC server for the GNOME desktop"
url="https://wiki.gnome.org/Projects/Vino"
arch=(i686 x86_64)
license=(GPL)
depends=(libnotify libxtst libsm telepathy-glib gtk3 libsecret avahi gnutls)
makedepends=(intltool networkmanager gnome-common git)
groups=(gnome)
_commit=67773d0842f546dbfde5ce0d9028f57673459b43  # master
source=("git+https://git.gnome.org/browse/vino#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  # Fixup missing tag for pkgver()
  git tag -f 3.22.0 2448f101df88d8f50c82b2969cd3cb4e9c755fc6
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname

  ./configure --prefix=/usr --sysconfdir=/etc \
      --libexecdir=/usr/lib/vino \
      --localstatedir=/var \
      --disable-http-server --with-secret

  # https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
